import React, { Component } from "react";
import { Route, Redirect } from "react-router-dom";

import MyNavLink from "@/components/MyNavLink";
import Message from "./components/Message";
import News from "./components/News";

export default class Home extends Component {
  render() {
    return (
      <>
        <h1>我是Home内容</h1>
        <div>
          <ul className="nav nav-tabs">
            <li>
              <MyNavLink to="/home/message">Message</MyNavLink>
            </li>
            <li>
              <MyNavLink to="/home/news">News</MyNavLink>
            </li>
          </ul>
          <div>
            <Route path="/home/message" component={Message} />
            <Route path="/home/news" component={News} />
            <Redirect to="/home/message" />
          </div>
        </div>
      </>
    );
  }
}
